<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
        content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <title>首页</title>
    <link rel="icon" href="me.ico">
    <link rel="stylesheet" href="css/index.css">
</head>

<body>
    <div class="content">
        <div class="content-snow">
            <div class="snow"></div>
        </div>
        <div class="content-introduce">
            <div class="introduce">
                <h1>Welcome to FayeW!</h1>
                <h2>You will start to know me here.</h2>
                <a href="">
                    <img src="https://s1.ax1x.com/2022/03/31/qR24W8.png" alt="">
                    <p>Recognize me.</p>
                </a>
            </div>
        </div>
        <div class="content-background">
            <div class="first"></div>
            <div class="second"></div>
            <div class="bear">
                <footer></footer>
            </div>
        </div>
    </div>
</body>
<script>
    var snowBg = document.querySelector('.content-snow');
    var arr = [];

    //随机生成雪花区域
    function creatSown(num) {
        for (var i = 0; i < num; i++) {
            var snow = document.createElement('div');
            snow.className = 'snow';
            snow.style.background = 'rgba(255, 255, 255,' + Math.random() + ' )';
            //随机生成的位置
            snow.style.top = Math.floor(Math.random() * 80) + '0px';
            snow.style.left = Math.floor(Math.random() * 130) + '0px';
            snowBg.appendChild(snow);
        }
    }
    //传递想要生生成的数量
    const num = Math.floor(Math.random(0, 1) *  200);
    creatSown(num);
</script>

</html>